home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12703 < prev    next >
Encoding:
Text File  |  1996-08-05  |  865 b   |  37 lines

  1. Path: news.u.washington.edu!dfitts
  2. From: dfitts@u.washington.edu (Douglas Fitts)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help! Can't read input from keyboard!
  5. Date: 2 Apr 1996 10:33:24 GMT
  6. Organization: University of Washington
  7. Message-ID: <4jqvpk$g49@nntp5.u.washington.edu>
  8. References: <4jq0ts$5mh@taniemarie.solon.com> <4jqpe9$2uh@news.tamu.edu>
  9. NNTP-Posting-Host: homer23.u.washington.edu
  10. NNTP-Posting-User: dfitts
  11.  
  12. ewm1006@tam2000.tamu.edu (Erik Wayne Mckee) writes:
  13.  
  14. >Peter Seebach (seebs@taniemarie.solon.com) wrote:
  15. >: I guess I thought I knew C, but maybe not.  The following program compiles
  16. >: without error with
  17.  
  18. <snip>
  19.  
  20. >:         (void) sscanf, "3", "%d", i;
  21. >:         (void) printf, "%d", i;
  22.  
  23. >Why not try the following:
  24. >#include <stdio.h>
  25. >int main(void) {
  26. >    int i=0;
  27. >    scanf("%d",i);
  28.                    ^^
  29. >    printf("%d",i);
  30. >}
  31.  
  32. uh, try:
  33.  
  34. scanf("%d", &i);
  35.  
  36. Doug
  37.